﻿<UserControl x:Class="CDC.SampleShell.Presentation.Content.ImportTab"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             mc:Ignorable="d" 
             d:DesignHeight="300" d:DesignWidth="600">
    <StackPanel Background="White"
                IsEnabled="{Binding IsBusy, Converter={StaticResource BooleanInverter}}"
                DataContext="{Binding ImportViewModel}"
                >
        <TextBlock Margin="10" FontSize="28" FontWeight="Light">Import Data</TextBlock>
        <StackPanel Height="10" />

        <Grid Margin="10, 0, 10, 0">
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>

            <StackPanel Orientation="Horizontal">
                <TextBox Background="#F9F9F9" Text="{Binding FilePath, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"  IsEnabled="False" x:Name="txtSourceFilePath" Width="410" />
                <StackPanel Width="10" />
                <Button Content="Browse..." Click="FileButton_Click"/>
            </StackPanel>

            <StackPanel Grid.Row="1"  Margin="0, 20, 0, 0">
                <Button HorizontalAlignment="Left" Content="Import" Command="{Binding ImportCommand}" />
            </StackPanel>

            <StackPanel Orientation="Vertical" Grid.Row="2" Margin="0, 20, 0, 0" HorizontalAlignment="Left">
                <TextBlock Text="Import status" Margin="0, 0, 0, 2" />
                <TextBox Background="#F9F9F9" x:Name="txtImportStatus" TextChanged="txtImportStatus_TextChanged" Text="{Binding ImportMessages, Mode=OneWay}" Width="580" AcceptsReturn="True" VerticalScrollBarVisibility="Visible" IsReadOnly="True" Height="180"/>
                
                <ProgressBar 
                    Margin="0, 10, 0, 0"
                    IsIndeterminate="False" Minimum="0" Maximum="100" Value="{Binding Progress, Mode=OneWay}"  Width="580" Height="14" Foreground="{StaticResource ThemeLightBrush}" />
            </StackPanel>
        </Grid>
    </StackPanel>
</UserControl>
